<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="./vue.js"></script>
    <style>
        div:not(#app){
            padding:50px;
        }
        #div1{
            background:rgb(94, 65, 65);
        }
        #div2{
            background:rgb(195, 156, 48);
        }
        #div3{
            background:rgb(131, 175, 35);
        }
    </style>
</head>
<body>
    <div id="app">
        <div id="div1" @click="fn1()">
            <div id="div2" @click.stop>
                <div id="div3" @click.stop></div>
            </div>
        </div>
        <hr>
        <div id="div1" @click.self="fn1()">
            <div id="div2">
                <div id="div3"></div>
            </div>
        </div>
        <hr>
        <button @click.once="fn2">按钮</button>
    </div>
    <script>
        let vm = new Vue({
            el:"#app",
            data:{
                msg:"你好vue"
            },
            methods:{
                fn1(){
                    alert(1)
                },
                fn2(){
                    alert("222")
                }
            }
        })
        console.log(vm)
        /*
       var  obj  = {
            name:"小明",
            fn(){
                console.log(this.name)
            },
            c:{
                name:"小花",
                fn(){
                    console.log(this.name)
                }
            }
        }

        obj.fn();
        obj.c.fn();
        obj.c.fn.call(obj);
        */
    </script>
    
</body>
</html>